import request from '@/utils/request'

// 查询退住办理列表
export function listOut_management(query) {
  return request({
    url: '/system/out_management/list',
    method: 'get',
    params: query
  })
}

// 查询退住办理详细
export function getOut_management(id) {
  return request({
    url: '/system/out_management/' + id,
    method: 'get'
  })
}

// 新增退住办理
export function addOut_management(data) {
  return request({
    url: '/system/out_management',
    method: 'post',
    data: data
  })
}

// 修改退住办理
export function updateOut_management(data) {
  return request({
    url: '/system/out_management',
    method: 'put',
    data: data
  })
}

// 删除退住办理
export function delOut_management(id) {
  return request({
    url: '/system/out_management/' + id,
    method: 'delete'
  })
}

// 根据老人ID获取合同信息
export function getContractByElderlyId(elderlyId) {
  return request({
    url: '/system/out_management/contract/' + elderlyId,
    method: 'get'
  })
}

// 获取审批通过页面的完整数据
export function getApprovalPassedData(businessId) {
  return request({
    url: '/system/out_management/approval-passed/' + businessId,
    method: 'get'
  })
}

// 提交解除合同
export function submitTermination(data) {
  return request({
    url: '/system/out_management/submitTermination',
    method: 'post',
    data: data
  })
}

// 提交账单调整
export function submitBillAdjustment(data) {
  return request({
    url: '/system/out_management/submitBillAdjustment',
    method: 'post',
    data: data
  })
}

// 提交账单审批
export function submitBillApproval(data) {
  return request({
    url: '/system/out_management/submitBillApproval',
    method: 'post',
    data: data
  })
}

// 提交副院长审批
export function submitVicePresidentApproval(data) {
  return request({
    url: '/system/out_management/submitVicePresidentApproval',
    method: 'post',
    data: data
  })
}

// 提交费用清算（第7步）
export function submitBillSettlement(data) {
  return request({
    url: '/system/out_management/submitBillSettlement',
    method: 'post',
    data: data
  })
}